/**
 * @author: jever
 * @date: 2019/3/12
 * @description:  imoocform.js
 */
import React from 'react'

export default function imoocForm(Comp) {
    return class WarpperComp extends React.Component{
        constructor(props) {
            super(props)
            this.state = {}
            this.handleChange = this.handleChange.bind(this)
        }

        handleChange(key, val) {
            console.log(key + ':' + val)
            this.setState({
                [key] : val
            })
        }
        render() {
            return <Comp handleChange={this.handleChange} state={this.state} {...this.props}></Comp>
        }
    }
}